
Topic Name
Introduction to C#
Environment Setup
C# Keywords
Contextual Keywords
C# Namespaces
What Is Class?
What is Object?
Data Types
Nullable Types
C# Variables
What are Access Modifiers?
What is Property?
What is Indexer?
Hello world Program
What is Type conversion?
What is if else condition?
What is Array?
What is Jagged Array?
What is ArrayList?
What is List?
What is string and StringBuilder?
What is for loop?
What is foreach loop?
What is switch?
What is Method?
What is method overloading?
What is Constructor?
What is constructor overloading?
What is Boxing and Unboxing?
What is delegate in C# and uses of delegates?
What is Inheritance?
What are Value types and Reference types?
What is Exception Handling?
What is struct?
What is Dictionary?
What is Hashtable?
What is interface?
What is Abstraction?
What is Polymorphism?
What is Enums?
What is Sealed Class?
What is Partial Class?
Extension Methods?
What is static?
What is Encapsulation?
Difference between Equality Operator (==) and Equals() Method in C# ?
What is IEnumerable?
What is Serializing?
What is LINQ?
Differences between IEnumerable and IQueryable?
What is Multithreading?
What is File Handling?
What is late binding and early binding?
What is Singleton Design Patterns?
Every class contain a Constructor. Constructor responsible to initialize the default value of the property or variable. Constructor name and class name must and should same. However, Constructor look like method but it has no return type. So, Constructor can’t return any things. Now we can see the example of the Constructor:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ObjectTest
{
internal class Students
{
public int a = 0;
public Students()
{
this.a = 10;
}
}
class Program
{
static void Main(string[] args)
{
Students obj = new Students();
Console.WriteLine("The value is : " + obj.a);
Console.ReadKey();
}
}
}
When student class will call then Students Constructor will call first. In the student’s class we can see the Constructor name as Students same name like class but no return type. We also see Constructor assign the value 10 and this value will print the main method.